<template>
  <div>
    home组件
    <!-- {{ $store.state.a.num }}
    {{ $store.state.b.num }} -->
    <button @click="_addNum">+</button>
    <!-- <a-button type="primary">
      Primary
    </a-button>
    <a-rate></a-rate> -->

    <el-button type="primary">主要按钮</el-button>
    <el-rate/>
    {{num}}
    <hr>
    {{num2}}
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
export default {
  name: 'home',
  data () {
    return {
      msg: '你好世界'
    }
  },
  methods: {
    _addNum () {
      /* this.$store.commit('b/addNum', 5) */
      this.addNum(100)
    },
    // ...mapMutations(['a/addNum'])
    ...mapMutations('a', ['addNum'])
  },
  mounted () {
    console.log(this)
  },
  computed: {
    ...mapState({
      num: state => state.a.num,
      num2: state => state.b.num
    })
  }
}
</script>

<style lang="scss" scoped>

</style>
